<?php
namespace app\promotion\validate;

use think\Validate;

/**
 * 验证
 */
class PromotionBargain extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'promotion_id'      => 'require|integer',
        'sponsor_user_id'   => 'require|integer'
    ];

    protected $field = [
        'promotion_id'      => '活动',
        'sponsor_user_id'   => '发起人',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'phone.mobile'      => '手机号码格式不正确',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'do_bargian'  => ['promotion_id', 'sponsor_user_id'],
    ];

}
